﻿@model  DataAccess.DTO.SysConfig_FlockManageDTO

<script src="~/Scripts/plugins/jquery.min.js"></script>
<script src="~/Scripts/plugins/layer/layer.min.js"></script>

@section Scripts{
    <script src="~/Scripts/plugins/validate/jquery.validate.min.js"></script>
    <script src="~/Scripts/plugins/validate/messages_zh.min.js"></script>
    <script src="~/Scripts/plugins/bootstrap.min.js"></script>
    <script src="~/Scripts/plugins/content.min.js"></script>
    <script src="~/Scripts/sys/lib/common_raw.js"></script>

    <script type="text/javascript">
        $(function () {
            $.validator.setDefaults({
                submitHandler: function () {
                    var kick_types = "";
                        $('input[name="kick_type"]:checked').each(function () {
                            kick_types+=($(this).val()+",");
                        });
                    common.invokeApi(
                    "post",
                    "editSysConfig.html",
                    {
                        id: $("#id").val(), rate_all: $("#rate_all").val(), rate: $("#rate").val(), rate_i: $("#rate_i").val(), rate_ii: $("#rate_ii").val(), name: $("#name").val(),
                        domain: $("#domain").val(), turing_key: $("#turing_key").val(), logo: $("#sitelogo").val(), send_format: $("#send_format").val(), send_tail: $("#send_tail").val(),
                        tkl_img: $('#tkl_img').val(), def_send_time: $('#def_send_time').val(), def_flock_time: $('#def_flock_time').val(), def_imgtext_time: $('#def_imgtext_time').val(), tb_open: $('#tb_open').val(), auto_reply: $('#auto_reply').val(), kick_type: kick_types, kick_word: $('#kick_word').val(),
                        search_word: $('#search_word').val(), welcome: $('#welcome').val(), def_pid: $('#def_pid').val(), root_str: $('#root_str').val()
                    },
                    function () { },
                    function (data) {
                        common.msg(data.Message, 1, function () {
                            $("#id").val(data.Datas);
                        });
                    },
                    function (data) {
                        common.msg(data.Message, 2);
                    },
                    function () { }
                    );

                }

            });
            $("#form1").validate({
                rules: {
                    rate_all: {
                        required: true,
                        digits: true,
                        range: [0, 100],
                        maxlength: 3
                    },
                    rate: {
                        required: true,
                        digits: true,
                        range: [0, 100],
                        maxlength: 3
                    },
                    rate_i: {
                        required: true,
                        digits: true,
                        range: [0, 100],
                        maxlength: 3
                    },
                    rate_ii: {
                        required: true,
                        digits: true,
                        range: [0, 100],
                        maxlength: 3
                    },
                    name: {
                        required: true,
                        maxlength: 15
                    },
                    domain: {
                        required: true,
                        maxlength: 200
                    },
                    turing_key: {
                        maxlength: 32
                    },
                    logo: {
                        required: true,
                        maxlength: 250
                    },
                    send_format: {
                        maxlength: 300
                    },
                    send_tail: {
                        maxlength: 300
                    }
                },
                messages: {
                    rate_all: "请输入0-100的整数",
                    rate: "请输入0-100的整数",
                    rate_i: "请输入0-100的整数",
                    rate_ii: "请输入0-100的整数",
                    name: {
                        required: "请输入网站名称",
                        maxlength: "网站名称最长15个字符"
                    },
                    domain: {
                        required: "请输入网站域名",
                        maxlength: "网站名称最长200个字符"
                    },
                    turing_key: {
                        maxlength: "图灵机器人Key长度过长"
                    },
                    logo: {
                        required: "请输入网站logo",
                        maxlength: "网站logo最长250个字符"
                    },
                    send_format: {
                        maxlength: "发单格式内容长度最长300个字符"
                    },
                    send_tail: {
                        maxlength: "发单小尾巴内容长度最长300个字符"
                    },
                        tb_open: {
                required: "请输入App Key/App Secret"
                         
                       },
                    tb_open: {
                        required: "请输入App Key/App Secret"
                         
                    }


                }
            });
        });
    </script>
}

<div class="row" style="opacity: 1;">
    <div class="col-lg-12">
        <div class="row">
            <div class="col-lg-12">
                <ol class="breadcrumb">
                    <li><a href="#">主页</a></li>
                    <li class="active"><span>站点配置</span></li>
                </ol>
                <h1>站点配置</h1>
            </div>
        </div>
        <div class="row">



            <div class="col-lg-12">
                <div class="main-box">
                    <header class="main-box-header clearfix">
                        <h2>站点配置</h2>
                    </header>

                    <form method="post" id="form1">

                        <input type="hidden" value="@Model.s_id" id="id" />

                        <div class="main-box-body clearfix">
                            <div class="row">
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="rate_all">总体扣除比率(%)</label>
                                            <div class="input-group  col-xs-8">

                                                <input type="text" class="form-control tt-query" id="rate_all" name="rate_all" placeholder="总体扣除比率" autocomplete="off" spellcheck="false" dir="auto" style="position: relative; vertical-align: top; background-color: transparent;" value="@Model.rate_all">


                                            </div>

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="rate">默认推广分成比率(%)</label>
                                            <div class="input-group col-xs-8">
                                                <input type="text" class="form-control" id="rate" name="rate" value="@Model.rate">

                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="datepickerDateComponent">默认一级分成比率(%)</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="rate_i" name="rate_i" value="@Model.rate_i">
                                            </div>

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="timepicker">默认二级分成比率(%)</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="rate_ii" name="rate_ii" value="@Model.rate_ii">
                                            </div>
                                        </div>
                                    </div>
                                </div>


                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="name">网站名称</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="name" name="name" value="@Model.name">
                                            </div>

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="domain">网站域名</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="domain" name="domain" value="@Model.domain">
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="turing_key">图灵机器人Key</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="turing_key" name="turing_key" value="@Model.turing_key">
                                            </div>

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="sitelogo">logo地址</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="sitelogo" name="sitelogo" value="@Model.logo">
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="send_format">发单格式</label>
                                            <div class="input-group  col-xs-8">
                                                <textarea id="send_format" name="send_format" class="form-control" rows="3">@Model.send_format</textarea>
                                            </div>

                                        </div>
                                    </div>
                                </div>

                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="send_tail">发单小尾巴</label>
                                            <div class="input-group  col-xs-8">

                                                <textarea class="form-control" id="send_tail" name="send_tail" rows="3">@Model.send_tail</textarea>
                                            </div>
                                        </div>
                                    </div>


                                </div>



                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="tkl_img">淘口令图片</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="tkl_img" name="tkl_img" value="@Model.tkl_img">
                                            </div>

                                        </div>
                                    </div>
                                </div>

                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="def_send_time">默认单与单发送间隔</label>
                                            <div class="input-group  col-xs-8">

                                                <input type="text" class="form-control" id="def_send_time" name="def_send_time" value="@Model.def_send_time">
                                            </div>
                                        </div>
                                    </div>


                                </div>


                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="def_flock_time">默认群与群发送间隔</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" id="def_flock_time" name="def_flock_time" class="form-control" value="@Model.def_flock_time">
                                            </div>

                                        </div>
                                    </div>
                                </div>

                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="def_imgtext_time">默认图文间隔</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="def_imgtext_time" name="def_imgtext_time" value="@Model.def_imgtext_time">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label>机器人自动踢人选项</label>
                                        <br>
                                        <div class="checkbox-nice checkbox-inline">
                                             
                                              <input type="checkbox"  @Html.Raw( Model.kick_type.Contains("link")?"checked":"") id="checkbox-inl-1" name="kick_type" value="link">
                                            <label for="checkbox-inl-1">
                                                链接秒踢
                                            </label>
                                        </div>
                                        <div class="checkbox-nice checkbox-inline">
                                            <input type="checkbox" id="checkbox-inl-2" name="kick_type" value="card" @Html.Raw(Model.kick_type.Contains("card") ? "checked":"" )>
                                            
                                            <label for="checkbox-inl-2">
                                                名片秒踢
                                            </label>
                                        </div>
                                        <div class="checkbox-nice checkbox-inline">
                                            <input type="checkbox" id="checkbox-inl-3" name="kick_type" value="share" @Html.Raw(Model.kick_type.Contains("share") ? "checked" : "")>
                                            <label for="checkbox-inl-3">
                                                分享秒踢
                                            </label>
                                        </div>

                                        <div class="checkbox-nice checkbox-inline">
                                            <input type="checkbox" id="checkbox-inl-4" name="kick_type" value="refresh" @Html.Raw(Model.kick_type.Contains("refresh") ? "checked" : "")>
                                            <label for="checkbox-inl-4">
                                                刷屏秒踢
                                            </label>
                                        </div>
                                        <div class="checkbox-nice checkbox-inline">
                                            <input type="checkbox" id="checkbox-inl-5" name="kick_type" value="much" @Html.Raw(Model.kick_type.Contains("much") ? "checked" : "")>
                                            <label for="checkbox-inl-5">
                                                爆群秒踢
                                            </label>
                                        </div>
                                        <div class="checkbox-nice checkbox-inline">
                                            <input type="checkbox" id="checkbox-inl-6" name="kick_type" value="at" @Html.Raw(Model.kick_type.Contains("at") ? "checked" : "")>
                                            <label for="checkbox-inl-6">
                                               @@直接踢人
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="kick_word">机器人踢人禁词：</label>
                                            <div class="input-group  col-xs-8">

                                                <textarea class="form-control" id="kick_word" name="kick_word" rows="8">@Model.kick_word</textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="auto_reply">机器人自动回复：</label>
                                            <div class="input-group  col-xs-8">

                                                <textarea class="form-control" id="auto_reply" name="auto_reply" rows="8">@Model.auto_reply</textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="welcome">机器人入群欢迎语：</label>
                                            <div class="input-group  col-xs-8">

                                                <textarea class="form-control" id="welcome" name="welcome" rows="8">@Model.welcome</textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="search_word">机器人搜索关键词：</label>
                                            <div class="input-group  col-xs-8">

                                                <textarea class="form-control" id="search_word" name="search_word" rows="8">@Model.search_word</textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="tb_open">淘宝开放平台参数(AppKey/AppSecret:用回车分割)</label>
                                            <div class="input-group  col-xs-8">

                                                <textarea class="form-control" id="tb_open" name="tb_open" rows="8">@Model.tb_open</textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="def_imgtext_time">默认pid</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="def_pid" name="def_pid" value="@Model.def_pid">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="row">
                                        <div class="form-group col-md-12">
                                            <label for="def_imgtext_time">站点导购root文本</label>
                                            <div class="input-group  col-xs-8">
                                                <input type="text" class="form-control" id="root_str" name="root_str" value="@Model.root_str">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-lg-offset-2 col-lg-10">
                                        <button id="submit" type="submit" class="btn btn-success">保存</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
